﻿using OA.Model.MyAttribute;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace OA.Model
{
    [Table("EmployeePosition")]
    public class EmployeePosition : BaseInfo
    {
        public int Status { get; set; }

        [MaxLength(10)]
        public string EmpID { get; set; }

        [MaxLength(20)]
        public string EmpName { get; set; }

        public int PositionID { get; set; }

        [Display(Name = "开始日期")]
        [MaxLength(10)]
        [Required]
        [Tag(TagEnum.Text, "required", "员工编号", 3, 10)]
        public string StartTime { get; set; }

        [Display(Name = "结束日期")]
        [MaxLength(10)]
        [Required]
        [Tag(TagEnum.Text, "required", "结束日期", 3, 10)]
        public string EndTime { get; set; }
    }

    public class SimpleEmployeePosition : SimpleInfo
    { 
        public string EmpID { get; set; }

        public string EmpName { get; set; }

        public int PositionID { get; set; }

        public static Expression<Func<EmployeePosition, SimpleEmployeePosition>> Map = m => new SimpleEmployeePosition() { EmpName = m.EmpName, EmpID = m.EmpID, PositionID = m.PositionID };

    }
}
